package net.piggy.config.security.encoder;

import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;


@Component
public class PiggyPasswordEncoder implements PasswordEncoder {

	private final String string = "_piggy";

	@Override
	public String encode(CharSequence rawPassword) {
		return rawPassword + string;
	}

	@Override
	public boolean matches(CharSequence rawPassword, String encodedPassword) {
		return encodedPassword.equals(rawPassword + string);
	}

}
